import Training.Solution;

import java.io.*;
import java.sql.*;

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
//    public static void main(String[] args) throws ParseException {
//        float weight = Float.parseFloat("aab");
//        float height = Float.parseFloat("bba");
//        String color = args[2];
//        Cow cow = new Cow(weight);
//        cow.printInfo(height, color);
//    }

//    public static void main(String[] args) {
//        Scanner in = new Scanner(System.in);
//        Test ts = new Test();
//        Test.ok.okk();
//        Vehicle c = new Car();
//        System.out.println(c.NoOfWheels());
//        Vehicle m = new Motorbike();
//        System.out.println(m.NoOfWheels());
//        Father father = new Father();
//        father.introduction();
//
//        Son son = new Son("Liu Shan", 2);
//        son.introduction();
//
//        Grandson grandson = new Grandson("Liu Chen", 3);
//        grandson.introduction();
//        Solution solution = new Solution();
//        System.out.println(solution.getIndexOne("sdfsdfsd"));
//
//        Library l = new Library();
//        l.management();
//        Library.Book b = new Library.Book("Java Tutorials", "ninechapter", 89);
//        b.show();
//        Outer.method().show();

    //        int x = 1, y = 2;
//        Try try01= new Try(x, y);
////        Person pp1 = new Person();
////        pp1.test();
////        System.out.print(try01.getAge());
//    }
//    private static void enter(Person person){
//        if(person instanceof Exams){
//            System.out.println(111222333);
//        }
//    }
//public class Main {
//    public static void main(String[] args) {
//        int number = new Solution().get("123.11");
//        System.out.println(number);
//    }
//}
//    public static void main(String[] args) {
//        Employee employee = new Employee();
//        employee.setName("Li Hua");
//        employee.setAge(21);
//        employee.setTelephone("13245667890");
//        employee.setOccupation("Senior Engineer");
//        employee.setSalary(100000);
//        employee.printInfo();
//    }
//    public static void main(String[] args) {
//        Solution solution = new Solution(args[0], args[1], args[2]);
//        solution.accessInnerProp();
//    }
//    public static void main(String[] args) {
//        // write your code here
//        BookImpl bml = new BookImpl();
//        bml.getBook("Gone with the Wind","paper");
//
//    }
//
//    public static void main(String[] args) {
//        Teacher.eat();
//        Student.eat();
//    }
//    public static void main(String[] args) {
////        int a =1;
////        int b =2;
////        Equals01 eq = new Equals01();
////        System.out.println(eq.equals(a));
//
//    }
//    static int a =1;
    public static void main(String[] args) {
//        Teacher eq = new Teacher();
//        Student st = new Student();
//        eq.setName("zhang");
//        eq.setAge(20);
//        st.setName("zhang");
//        st.setAge(20);
//        System.out.println(eq.getName().equals(st.getName()));
//        int[] arr = new int[5];
//        try{    //在try块中运行代码
//            arr[5] = 1;    //当代码出现异常时，异常会被捕获，并在catch块中得到异常类型的对象
//        }catch (ArrayIndexOutOfBoundsException e){   //捕获的异常类型
//            System.out.println("程序运行出现异常！");  //出现异常时执行
//        }
////后面的代码会正常运行
//        System.out.println("lbwnb");
//         int a = 1;
//        public static int a;
//        Solution solution = new Solution();
//        double num1 = 1.1,num2 = 2.2;
//        double num = solution.numberSummation(num1,num2);
//        System.out.println(num);
        //字节流复制
//        String filenamein = "D:"+File.separator+"软件"+File.separator+"tmp"+File.separator+"class14"+File.separator+"class14.txt";
//        String filenameout = "D:"+File.separator+"软件"+File.separator+"tmp"+File.separator+"class14.txt";
//        try (FileInputStream fileInputStream = new FileInputStream(filenamein);
//             FileOutputStream fileOutputStream = new FileOutputStream(filenameout);
//        ) {
//            byte[] bytes = new byte[1024];
//            int len=0;
//            while((len=fileInputStream.read(bytes))!=-1){
//                fileOutputStream.write(bytes,0,len);
//            }
//        } catch (IOException e) {
//            e.printStackTrace();
//        }
        //字符流复制
//        String filenamein = "D:"+File.separator+"软件"+File.separator+"tmp"+File.separator+"class14"+File.separator+"class14.txt";
//        String filenameout = "D:"+File.separator+"软件"+File.separator+"tmp"+File.separator+"class14.txt";
//        try (FileWriter fileWriter = new FileWriter(filenameout);FileReader fileReader = new FileReader(filenamein);) {
//            int len = 0;
//            char[] chars = new char[1024];
//            while((len = fileReader.read(chars))!=-1){
//                fileWriter.write(chars,0,len);
//            }
//        } catch (IOException e) {
//            e.printStackTrace();
//        }

//        //1.通过DriverManager来获得数据库连接
//        try (Connection connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/test01","root","9683269");
//             //2.创建一个用于执行SQL的Statement对象
//             Statement statement = connection.createStatement();)
//        {
//            //3.执行SQL语句，并得到结果集
//            ResultSet set = statement.executeQuery("select * from trytry01");
//            //4.(1)查看结果
//            while(set.next()){
//                System.out.println(set.getString(1));
//            }
//            //(2)指定类型获取
//            int age = set.getInt(1);
//            //(3)通过字段名和字符串
//            String age1 = set.getString("age");
//            //(4)通过字段名和指定字符类型
//            String age2 = set.getString("age");
//        } catch (SQLException e) {
//            throw new RuntimeException(e);
//        }

    }

}